package vn.orderonline.core.dao.entity;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Table;

@Entity
@Table(name = "BASKET_FOOD")
public class BasketFood implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private BasketFoodId id;
	private String foodName;
	private Float price;
	private Integer amount;
	
	public BasketFood() {
		
	}
	
	@EmbeddedId
	@AttributeOverrides({
		@AttributeOverride(name = "orderId", column = @Column(name = "ORDER_ID")),
		@AttributeOverride(name = "foodId", column = @Column(name = "FOOD_ID"))
	})
	public BasketFoodId getId() {
		return id;
	}

	public void setId(BasketFoodId id) {
		this.id = id;
	}

	@Column(name = "FOOD_NAME", nullable = false, length = 100)
	public String getFoodName() {
		return foodName;
	}

	public void setFoodName(String foodName) {
		this.foodName = foodName;
	}

	@Column(name = "PRICE", nullable = false, precision = 20, scale = 2)
	public Float getPrice() {
		return price;
	}

	public void setPrice(Float price) {
		this.price = price;
	}

	@Column(name = "AMOUNT", nullable = false, precision = 10, scale = 0)
	public Integer getAmount() {
		return amount;
	}

	public void setAmount(Integer amount) {
		this.amount = amount;
	}
	
}
